package info.nightbrest.agt.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.web.bindery.event.shared.EventBus;

/**
 * Entry point classes define <code>onModuleLoad()</code>
 */
public class Agt implements EntryPoint
{
	private static AgtApp app = null;

	public static final AgtResources images = GWT.create(AgtResources.class);

	public static AgtApp getApp()
	{
		if (app == null)
			app = new AgtApp();

		return app;
	}

	public static EventBus getEventBus() {
		return getApp().getEventBus();
	}

	public static AgtDispatcher getDispatcher() {
		return getApp().getDispatcher();
	}

	/**
	 * This is the entry point method.
	 */
	public void onModuleLoad()
	{
		getApp().init().go(RootPanel.get("page-layout"));
	}
}